package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.market.AftersaleListVo;
import com.cskaoyan.service.AftersaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("admin/aftersale")
public class AftersaleController {

    @Autowired
    AftersaleService aftersaleService;

    //page=1&limit=20&orderId=5&status=&sort=add_time&order=desc
    @GetMapping("list")
    public BaseRespVo list(BaseParam baseParam,Integer orderId,String status) {
        AftersaleListVo aftersaleListVo = aftersaleService.list(baseParam,orderId,status);
        return BaseRespVo.ok(aftersaleListVo);
    }


    @PostMapping("batch-recept")
    public BaseRespVo batchRecept(@RequestBody Map map) {
        aftersaleService.batchRecept(map);
        return BaseRespVo.ok();
    }

    @PostMapping("batch-reject")
    public BaseRespVo batchReject(@RequestBody Map map) {
        aftersaleService.batchReject(map);
        return BaseRespVo.ok();
    }

}
